package com.example.config;

import com.example.interceptors.LoginInterceptors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptors loginInterceptors;

    public void addInterceptors(InterceptorRegistry registry) {
//        登录注册接口不进行拦截其他全部进行拦截
//        无法直接请求swagger文档
        registry.addInterceptor(loginInterceptors).excludePathPatterns("/user/login", "/user/register",
                "/user/codeLogin");

    }


}
